package org.example._04mybatis.mapper;


import org.apache.ibatis.annotations.*;
import org.example._04mybatis.pojo.WeiBo;
import org.example._04mybatis.pojo.WeiBoVO1;
import org.example._04mybatis.pojo.WeiBoVO2;

import java.util.List;

@Mapper
public interface WeiBoMapper {
//    @Insert("insert into blog.weibo(content,created,user_id) " +
//            "values (#{content},#{created},#{user_id})")
    int insertWeiBo(WeiBo weiBo);

//    @Delete("delete from blog.weibo where id=#{id}")
    int deleteWeiBo(Integer id);

//    @Update("update weibo " +
//            "set content=#{content},created=#{created},user_id=#{user_id} " +
//            "where id=#{id}")
    int updateWeiBo(WeiBo weibo);

//    @Select("select id,content,created,user_id " +
//            "from blog.weibo " +
//            "where id=#{id}")
    WeiBo selectWeiBo(Integer id);

//    @Select("select id,content,created,user_id " +
//            "from blog.weibo ")
    List<WeiBo> selectAllWeiBo();

//    @Select("select content,created from weibo where id=#{id}")
    WeiBoVO1 selectWeiBoVO1ById(Integer id);

//    @Select("select content,created,user_id from weibo ")
    List<WeiBoVO2> selectAllWeiBoVO2();

    //动态修改微博的接口
    int dynamicUpdateWeiBo(WeiBo weiBo);

    //动态删除微博
    int dynamicDeleteWeiBo(Integer[] ids);
}
